package top.kaoshanji.p1ch01a;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * 代码清单-p1ch01a-24页a：参数传递-数组
 * author kaoshanji
 * ^_^
 * create time 2025/2/15 16:37
 */
public class Array {

    private static final Logger logger = LogManager.getLogger(Array.class);

    public static void main(String[] args) {

        int[] arr = {10,20,30,40};
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }

        logger.info("...调用reset方法之后...");

        reset(arr);

        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }

    }

    public static void reset(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            arr[i] = i;
        }
    }



}
